import sys
import os
from PySide6.QtWidgets import *
from PySide6.QtGui import *
from PySide6.QtCore import *

class Demo(QWidget):
    def __init__(self, parent=None):
        super().__init__(parent)
        self.parent = parent
        layout = QVBoxLayout()
        layout.setAlignment(Qt.AlignmentFlag.AlignTop)        
        btn = QCommandLinkButton('Default CommandLink Button')
        btn.clicked.connect(self.OnClicked)
        layout.addWidget(btn)

        btn = QCommandLinkButton('CommandLink Button',description='Some Description')
        btn.clicked.connect(self.OnClicked)
        layout.addWidget(btn)

        btn = QCommandLinkButton('CommandLink Button',description='Image CommandLink Button')
        btn.setIcon(QIcon(f'{self.parent.getAppDir()}/resources/confirm.png'))
        btn.clicked.connect(self.OnClicked)
        layout.addWidget(btn)

        self.setLayout(layout) 
    def OnClicked(self,event):
        self.parent.OnShowMessage(f'CommandLink Button Clicked') 

def runDemo(parent):
    wigdet =  Demo(parent)
    return wigdet